from django.db import models
from django.contrib.auth.models import User
import os
import datetime


class Activation(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    created_at = models.DateTimeField(auto_now_add=True)
    code = models.CharField(max_length=20, unique=True)
    email = models.EmailField(blank=True)
    

class File(models.Model):
    name = models.CharField(max_length=255)
    file = models.ImageField(upload_to='uploads/')

    def __str__(self):
        return self.name


class Video(models.Model):
    name = models.CharField(max_length=255)  # 视频文件名
    path = models.CharField(max_length=255)  # 视频文件路径
    uploaded_at = models.DateTimeField(auto_now_add=True)  # 上传时间

